/*
* Copyright (c) 2005, 2017, EVECOM Technology Co.,Ltd. All rights reserved.
* EVECOM PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.bif.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * @author Ted Wang
 * @created 2017/9/18 15:30
 */
@Controller
@RequestMapping("test")
public class TestController {
    @RequestMapping(params = "t")
    public String t(){
        return "index";
    }

    @RequestMapping("login")
    public String login(HttpServletResponse response, HttpServletRequest request){
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        HttpSession session = request.getSession();
        if (username.equals("maxadmin")&&password.equals("tiv0li")){
            session.setAttribute("User","User");
            return "success";
        }

        return "login";
    }
}
